g_param_spec_int ("year",
P_("Year"),
P_("The selected year"),
- 0, G_MAXINT >> 9, 0,
- G_PARAM_READWRITE));
+ 1, 9999, 1,
+ G_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
/**
* GtkCalendar:month:
P_("Month"),
P_("The selected month (as a number between 0 and 11)"),
0, 11, 0,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
/**
* GtkCalendar:day:
P_("Day"),
P_("The selected day (as a number between 1 and 31, or 0 to unselect the currently selected day)"),
0, 31, 0,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
/**
* GtkCalendar:show-heading:
g_date_time_get_month (priv->date),
g_date_time_get_day_of_month (priv->date),
0, 0, 0);
- gtk_calendar_select_day (calendar, date);
- g_date_time_unref (date);
+ if (date)
+ {
+ gtk_calendar_select_day (calendar, date);
+ g_date_time_unref (date);
+ }
break;
case PROP_MONTH:
date = g_date_time_new_local (g_date_time_get_year (priv->date),
- g_value_get_int (value),
+ g_value_get_int (value) + 1,
g_date_time_get_day_of_month (priv->date),
0, 0, 0);
- gtk_calendar_select_day (calendar, date);
- g_date_time_unref (date);
+ if (date)
+ {
+ gtk_calendar_select_day (calendar, date);
+ g_date_time_unref (date);
+ }
break;
case PROP_DAY:
date = g_date_time_new_local (g_date_time_get_year (priv->date),
g_date_time_get_month (priv->date),
- g_value_get_int (value),
+ g_value_get_int (value) + 1,
0, 0, 0);
- gtk_calendar_select_day (calendar, date);
- g_date_time_unref (date);
+ if (date)
+ {
+ gtk_calendar_select_day (calendar, date);
+ g_date_time_unref (date);
+ }
break;
case PROP_SHOW_HEADING:
gtk_calendar_set_show_heading (calendar, g_value_get_boolean (value));
g_value_set_int (value, g_date_time_get_year (priv->date));
break;
case PROP_MONTH:
- g_value_set_int (value, g_date_time_get_month (priv->date));
+ g_value_set_int (value, g_date_time_get_month (priv->date) - 1);
break;
case PROP_DAY:
- g_value_set_int (value, g_date_time_get_day_of_month (priv->date));
+ g_value_set_int (value, g_date_time_get_day_of_month (priv->date) - 1);
break;
case PROP_SHOW_HEADING:
g_value_set_boolean (value, gtk_calendar_get_show_heading (calendar));